package com.test.restruant.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.test.restruant.pojo.DishTable;
import com.test.restruant.service.DishTableService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {
    //@Autowired
    @Reference
    private DishTableService dishTableService;

    @RequestMapping("index.html")
    public String index(Model model) {
        List<DishTable> tables = dishTableService.getTableList(null);
        model.addAttribute("tables", tables);
        return "index";
    }
}
